package com.teaching.management.entity;

import jakarta.persistence.*;
import lombok.Data;
import java.util.Date;

@Data
@Entity
@Table(name = "teacher")
public class Teacher {
    @Id
    @Column(name = "teacher_id")
    private String teacherId;

    @Column(name = "user_id")
    private Integer userId;

    @Column(name = "name", nullable = false)
    private String name;

    @Column(name = "gender", nullable = false)
    private String gender;

    @Column(name = "department", nullable = false)
    private String department;

    @Column(name = "title", nullable = false)
    private String title;

    @Column(name = "birth_date", nullable = false)
    private Date birthDate;

    @Column(name = "hire_date", nullable = false)
    private Date hireDate;

    @Column(name = "email")
    private String email;

    @Column(name = "phone")
    private String phone;

    @Column(name = "office")
    private String office;

    @Column(name = "bio", length = 1000)
    private String bio;

    @Column(name = "avatar")
    private String avatar;

    @Transient
    private Integer courseCount;

    @Transient
    private Integer studentCount;

    @ManyToOne
    @JoinColumn(name = "user_id", insertable = false, updatable = false)
    private User user;
}